package com.abs.orm.db.dao;

import org.junit.Test;

import com.abs.orm.db.jdbc.ConnectionManager;
import com.abs.orm.db.jdbc.JdbcType;
import com.ads.orm.db.model.Column;
import com.ads.orm.db.model.Table;

public class DaoTest {
	@Test
	public void getTables() {
		for (Table table : DaoForMySQL.getInstance().getTables()) {
			System.out.println(table.getTableName());
			DaoForMySQL.getInstance().getColumns(table);

			for (Column column : table.getColumns())
				System.out.println("\t" + column.getColumnName());
		}
		ConnectionManager.close();

		for (Table table : DaoForOracle.getInstance().getTables()) {
			System.out.println(table.getTableName());
			DaoForOracle.getInstance().getColumns(table);

			for (Column column : table.getColumns())
				System.out.println("\t" + column.getColumnName());
		}
		ConnectionManager.close(JdbcType.Oracle);
	}
}
